#include"proxy.h"
#include <iostream>
#include <thread>
#include <vector>
void performRequest(const std::shared_ptr<Subject>& subject, int index) {
    std::string data = "Data" + std::to_string(index);
    std::string result = subject->request(data);
    std::cout << "Thread " << index << ": " << result << std::endl;
}
int main(int argc, char *argv[])
{
    std::shared_ptr<Subject> subject = std::make_shared<Proxy>();

    std::vector<std::thread> threads;
    int numThreads = 5;

    for (int i = 0; i < numThreads; ++i) {
        threads.emplace_back(performRequest, subject, i);
    }

    for (auto& thread : threads) {
        thread.join();
    }

    return 0;
}
